package com.yrcm.eduapp.activity.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import com.yrcm.eduapp.R;

public class BofangJLShijianAdapter extends BaseAdapter {
	private String[] data;
	private Context mContext;
	private LayoutInflater inflater;

	public BofangJLShijianAdapter(Context context, String[] arr) {
		this.mContext = context;
		this.data = arr;
		this.inflater = LayoutInflater.from(mContext);
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return data.length;
	}

	@Override
	public Object getItem(int arg0) {
		// TODO Auto-generated method stub
		return arg0;
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	@Override
	public View getView(int position, View view, ViewGroup parent) {
		// TODO Auto-generated method stub
		HolderView holder;
		if (view == null) {
			view = inflater.inflate(R.layout.bofangjilu_sijian_item, null);
			holder = new HolderView();
			holder.img1 = (ImageView) view.findViewById(R.id.img1);
			holder.nameTxt = (TextView) view.findViewById(R.id.txt1);

		} else {
			holder = (HolderView)view.getTag();
		}
		
		view.setTag(holder);
		return view;
	}

	class HolderView {
		ImageView img1;
		TextView nameTxt;

	}

}
